package facade.pagemaker;

import facade.Database;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class PageMaker {
    private PageMaker() {

    }
    public static void makeWelcomePage(String mailaddr,String filename) throws IOException {
        Properties mailprop= Database.getProperties("maildata");
        String username=mailprop.getProperty(mailaddr);
        HtmlWriter writer=new HtmlWriter(new FileWriter(filename));
        writer.title("Welcome to "+username+" 's page!");
        writer.paragraph(username+" 欢迎来到"+username+" 的主页。");
        writer.paragraph("等着你的邮件哦！");
        writer.mailto(mailaddr,username);
        System.out.println(filename+" is created for "+mailaddr+" ("+username+")");

    }
}
